package com.k.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.k.demo.entity.FoodKind;
import com.k.demo.mapper.FoodKindMapper;
import com.k.demo.service.FoodKindService;

@Service
public class FoodKindServiceImpl implements FoodKindService{
	
	@Autowired
	private FoodKindMapper foodKindMapper;
	
	@Override
	public List<FoodKind> getAll() {
		return foodKindMapper.selectAll();
	}

	@Override
	public int addFoodKind(FoodKind foodkind) {
		// TODO Auto-generated method stub
		return foodKindMapper.insert(foodkind);
	}

	@Override
	public int deleteFoodKindForEach(List<Integer> deletelist) {
		// TODO Auto-generated method stub
		return foodKindMapper.deleteForEach(deletelist);
	}

	@Override
	public int updateFoodKind(FoodKind foodkind) {
		// TODO Auto-generated method stub
		return foodKindMapper.update(foodkind);
	}

	@Override
	public int delete(int food_kind_id) {
		// TODO Auto-generated method stub
		return foodKindMapper.delete(food_kind_id);
	}

	@Override
	public List<FoodKind> getByNameAndId(FoodKind foodkind) {
		// TODO Auto-generated method stub
		return foodKindMapper.selectByNameAndId(foodkind);
	}
}
